************
INTRODUCTION
************

This file describes how to set up and use the PHP wrapper code with Melissa DATA's Name Object.


*************
PREREQUISITES
*************

To make use of the Name Object PHP wrapper you will need:

* An installation of a PHP. Wrapper tested with PHP 5.2.6.

* The Melissa DATA Name Object library and data files installed.
  These files are installed automatically if you run setup.exe. By default, the Name Object 
  Library (mdName.dll) is installed in:
	C:\Program Files\Melissa DATA\DQT\NameObj\dll_32bit
* 64bit version available in C:\Program Files\Melissa DATA\DQT\NameObj\dll_64bit

  and the Name Object data files in:
	C:\Program Files\Melissa DATA\DQT\data


Note For PHP 5.3.X:


The current SWIG source file 'mdNamePHPWrapper.cpp' on the disc is not compatible with PHP Version 5.3.X.
The SWIG wrapper was compiled using PHP 5.2.X which uses the zend_error_noreturn() function. This function
is no longer available in PHP 5.3.X.
To use 'mdNamePHPWrapper.dll' with PHP 5.3.X, you need to make changes in 'mdNamePHPWrapper.cpp' manually.
Open 'mdNamePHPWrapper.cpp' in a text editor and replace all zend_error_noreturn with zend_error. After making these changes in 'mdNamePHPWrapper.cpp', compile the wrapper again using the 'CreateDll.bat' file.


You will need to know the location of these items in order to install and run the PHP wrapper.


**********************
Wrapper compatibility
**********************

If the provided pre-compiled wrappers are not compatible with your environment, the necessary files for compilation can be found in the 'interfaces' folder of the object's main directory.




***********
Demo Mode
***********

Without a valid license string, Name Object will not function. Please contact your sales representative
to obtain a free fully functional 30-day license string. After 30 days, the Object must be purchased 
before continued usage. Please call 1-800-MELISSA ext. 3 for more information.



*************
Installation
*************

Copy the entire folder that contains this readme.txt into a local directory on your computer.




*************
Files
*************

Here is a brief overview of the files contained in the sample.

NameSample.php is a script sample that you can run from the command line. 

NameObjectPHPSample.php is a php webpage that you can host on a local webserver. 

mdNamePHPWrapper.php is a php file that is called by the sample code. This file will load the 
	php_mdNamePHPWrapper.dll extention.
php_mdNamePHPWrapper.dll is the php extention.

mdName.dll is the Name Object engine, not present in this directory. However, you may need a
	copy of this dll, which is installed to C:\Program Files\Melissa DATA\DQT\NameObj\dll_32bit
* 64bit version available in C:\Program Files\Melissa DATA\DQT\NameObj\dll_64bit
	by default.




*************
Setup
*************

1. You will need to tell PHP where to load the php_mdNamePHPWrapper.dll extension. 
   To do so, you can do one of the following:
	
	Copy php_mdNamePHPWrapper.dll to your PHP extention folder, usually 
	"C:\Program Files\PHP\ext" by default

	or

	Alter the php extension folder by changing php.ini.
		extension_dir ="C:\Program Files\PHP\ext"

2. If you are using the sample script NameSample.php:

	Open a command window. 

	Adding the directory containing mdName to your PATH environment variable. 
	ex: set PATH=%PATH%;C:\Program Files\Melissa DATA\DQT\NameObj\dll_32bit

* 64bit version available in C:\Program Files\Melissa DATA\DQT\NameObj\dll_64bit

	type "php NameSample.php" to execute the script

3. If you are using the web page sample NameObjectPHPSample.php:

	Copy NameObjectPHPSample.php and mdNamePHPWrapper.php to your webserver (ie: C:\Inetpub\wwwroot)

	Copy mdName.dll into the PHP directory (usually C:\Program Files\PHP) or the same directory as
	mdNamePHPWrapper.php.
	
	Open up the sample in a browser (IE: http://localhost/NameObjectPHPSample.php)




**************************
Setting up the Sample Code
**************************

Open NameSample.php for editing. You must set the a license string that you receive from your Melissa Data
	#Put License and Directory of Name Object Data Files here
	$License = "License Here";
	$DataPath = "C:\Program Files\Melissa Data\DQT\data";

For NameObjectPHPSample.php, you must do the sample thing and set the License and DataPath:
	//******************************************************//
	//Put License String and Path to Name Object Data Files//
	//******************************************************//
	$License="License Here";
	$DataPath="C:/Program Files/Melissa Data/DQT/data";



*******
Updates
*******

The files generated/included in this wrapper do not need to be changed for DQ Suite updates unless there is 
a method signature change in the object. If a new method is added, you will need to rebuild the wrapper to use 
the new method. 



****
Note
****

Here are some general solutions if you run into problems:

Q. I get an error saying "Unable to load dynamic library. The Specified module cannot be found"
A. This means that either mdNamePHPWrapper.php cannot find php_mdNamePHPWrapper.dll, or php_mdNamePHPWrapper.dll 
cannot find mdName.dll. Make sure to follow all the instructions in the Setup section above. 

Q. I get an error saying "Unable to load dynamic library. Access is denied"
A. This means that either PHP or your webserver does not have the correct permissions to access mdName.dll or 
php_mdNamePHPWrapper.dll. Make sure the directories containing these dlls are granted the necessary permissions.


Q. I get "Cannot find mdName.dat" initialize error but I am pointing to the right path.
A. This could also be a permission issue. Make sure PHP and you web server have the required permissions to the 
directory containing the data files.

Q. I get an error saying "can't find php5ts.dll."
A. The current php_mdNamePHPWrapper.dll was compiled using PHP 5.2.6. You are probably using another version of
PHP that is not compatible. You will need another version of php_mdNamePHPWrapper.dll that uses the version of PHP 
on your system. Please look in the "Source" folder and read the readme for instructions. 


COPYRIGHT NOTICE

(C) 2014 Melissa Data Corporation. All rights reserved.
